<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <meta content="yes" name="apple-mobile-web-app-capable">
          <meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, target-densityDpi=device-dpi" />
          <!-- 微软的老式浏览器 -->
          <meta name="MobileOptimized" content="320">
          <!-- 启用360浏览器的极速模式(webkit) – -->
          <meta name="renderer" content="webkit">
          <!-- 避免IE使用兼容模式 -->
          <meta http-equiv="X-UA-Compatible" content="IE=edge">
          <!-- 针对手持设备优化，主要是针对一些老的不识别viewport的浏览器，比如黑莓 -->
          <meta name="HandheldFriendly" content="true">
          <!-- uc强制竖屏 -->
          <meta name="screen-orientation" content="portrait">
          <!-- QQ强制竖屏 -->
          <meta name="x5-orientation" content="portrait">
          <!-- UC强制全屏 -->
          <meta name="full-screen" content="yes">
          <!-- QQ强制全屏 -->
          <meta name="x5-fullscreen" content="true">
          <!-- UC应用模式 若开启长按无法复制链接-->
          <!--meta name="browsermode" content="application"-->
          <!-- QQ应用模式 -->
          <meta name="x5-page-mode" content="app">
          <!--网站开启对web app程序的支持-->
          <meta name="apple-touch-fullscreen" content="yes">
          <!--在web app应用下状态条（屏幕顶部条）的颜色-->
          <meta name="apple-mobile-web-app-status-bar-style" content="black">
          <!-- windows phone 点击无高光 -->
          <meta name="msapplication-tap-highlight" content="no">
          <!--移动web页面是否自动探测电话号码-->
          <!--<meta http-equiv="x-rim-auto-match" content="none">-->
          <!--手机号码显示为拨号链接-->
          <meta name="format-detection" content="telephone=no">
          <meta http-equiv="Cache-Control" content="max-age=300" />
          <meta http-equiv="Expires" content="300" />
          <title>编辑资料</title>
          <link rel="stylesheet" href="../css/reset.css">
          <link rel="stylesheet" href="../css/edit-profile.css">
          <link rel="stylesheet" href="../assets/swiper/css/swiper.min.css">
        <link rel="stylesheet" href="../assets/layer_mobile/need/layer.css">
        <script src="http://www.jq22.com/jquery/jquery-1.10.2.js"></script>
        <script src="../assets/layer_mobile/layer.js"></script>
        <!-- <script src="../js/jquery.min.js"></script> -->
        <script type="../js/picker.js"></script>
        <script src="../js/jquery.nicescroll.min.js"></script>
        <script src="../assets/swiper/js/swiper.jquery.min.js"></script>
        <script src="../js/common.js"></script>
    </head>
    <body>
      <div class="container">
        <ul>
          <li class="year">
            <h4>网贷投资经验</h4>
            <p><span></span>年</p>
          </li>
          <li class="lei">
            <h4>踩雷次数</h4>
            <p><span></span>次</p>
          </li>
          <li class="plat">
            <h4>投资平台</h4>
            <p><span></span>家</p>
          </li>
        </ul>
      </div>
      <div class="short-comment" id="wordCounta">
            <textarea class="comment-textarea" cols="5" type="text" maxlength="30" placeholder="请输入您的个人简介..." ></textarea>
            <span class="wordWrap">
            <var class="wordHave">0</var> /<var class="word"> 30</var>
            </span>
        </div>
       <div class="btn">
        <p>提交</p>
      </div>
      <!-- 数字 -->
      <div class="number number-year">
        <div class="swiper-container">
          <div class="swiper-wrapper">
          </div>
        </div>
      </div>
      <div class="number number-lei">
        <div class="swiper-container">
          <div class="swiper-wrapper">
          </div>
        </div>
      </div>
      <div class="number number-plat">
        <div class="swiper-container">
          <div class="swiper-wrapper">
          </div>
        </div>
      </div>
      <script type="text/javascript">
        $(function(){

          for (var i = 0; i < 100; i++) {
            var li = '<div class="swiper-slide"><div>'+i+'</div></div>';
            $('.swiper-wrapper').append(li);
          };
          var mySwiper = new Swiper ('.swiper-container', {
            slidesPerView: 5,
            direction: 'vertical',
            loop: false,
          })        
      
          $('.year').click(function(){
            $('.number').each(function(i,e){
                  $(e).css('display','none');
                })
            $('.number-year').css('display','block');
            
              $('.number-year .swiper-container .swiper-wrapper div').click(function(){
                $('.number-year').css('display','none');
                 $('.year p span').html($(this).children('div').html())
           });
         
          })
          $('.lei').click(function(){
            $('.number').each(function(i,e){
                  $(e).css('display','none');
                })
            $('.number-lei').css('display','block');
              $('.number-lei .swiper-container .swiper-wrapper div').click(function(){console.log(1)
                $('.number-lei').css('display','none');
                 $('.lei p span').html($(this).children('div').html())
           });
          
          })
          $('.plat').click(function(){
            $('.number').each(function(i,e){
                  $(e).css('display','none');
                })
            $('.number-plat').css('display','block');
            
              $('.number-plat .swiper-container .swiper-wrapper div').click(function(){
                $('.number-plat').css('display','none');
                 $('.plat p span').html($(this).children('div').html())
           });
          
          })

          $('.btn').click(function(){
            var arr = [];
            $('span').each(function(i,e){
              arr[i] = $(e).html();
            });
            console.log(arr)
              if(arr[0] != ''&&arr[1]!=''&&arr[2] !=''){
                layer.open({
              content: '提交成功！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
                
              }else{
                layer.open({
              content: '请输入完整信息！'
              ,skin: 'msg'
              ,time: 2 //2秒后自动关闭
            });
              }
            
          })

    })
// 个人简介
  $(function(){
        var wordCount = $("#wordCounta"),
            textArea = wordCount.find("textarea"),
            word = wordCount.find(".word");
            wordHave = wordCount.find(".wordHave");
        statInputNum(textArea,word,wordHave);
    });
    function statInputNum(textArea,numItem,num) {
        var max = numItem.text(),
            curLength;
        textArea[0].setAttribute("maxlength", max);
        curLength = textArea.val().length;
        num.text(curLength);
        textArea.on('input propertychange', function () {
            var _value = $(this).val().replace(/\n/gi,"");
            num.text(_value.length);
        });
    }
      </script>
    </body>
</html>